from flask import Blueprint,render_template,jsonify
from flask.views import MethodView

main = Blueprint('main',__name__)

"""flask中实现FBV开发模式"""
@main.route("/")
def index():
    return "这是FBV模式的Hello World"



"""flask中实现CBV开发模式"""
class IndexView(MethodView):

    # methods = ['POST']  # 只允许POST请求访问
    # decorators = []  # 如果想给所有的get,post请求加装饰器，就可以这样来写，也可以单个指定

    def get(self):

        context = {
            'name':'zl'
        }
        return render_template('index.html',**context)
        # return context
        # return 'zl'


    def post(self):
        pass

# TODO : 电影模块后台视图函数
class MovieListView(MethodView):

    def get(self):
        pass


class MovieDetailView(MethodView):
    def get(self):
        pass